from abc import ABC, abstractmethod
from typing import Any, Type

from pydantic import BaseModel


class BaseCacheProvider(ABC):
    @abstractmethod
    async def dispose_callback(self) -> None:
        pass

    @abstractmethod
    async def get_by_id(self, key: str, model_name: Type[BaseModel]) -> BaseModel | None:
        pass

    @abstractmethod
    async def get_many_ids(self, keys: list[str], model_name: Type[BaseModel]) -> list[BaseModel] | None:
        pass

    @abstractmethod
    async def put_by_id(self, key: str, data: BaseModel):
        pass

    @abstractmethod
    async def put_many_ids(self, data: dict[str, BaseModel]):
        pass
